<%@ page language="java" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
	<head>
		<%@ include file="/view/common/header.jsp"%> 
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<title>${entity.cnName}管理</title>
		<script type="text/javascript">
		
			//查询
			function search(){
				$('#dg').datagrid('load',{
					<#list searchConditionList as  token>
					    ${token.compontId}:   $("#${token.compontId}").val() ,
			   		</#list>
				});
			}
		</script>
	</head>
<body style="margin:1px;">
	<!-- 工具栏  -->
	<div id="tb">
		<div>
			<a href="javascript:openAddDialog('添加${entity.cnName} ' ,'../${entity.lowerName}/save.do')" class="easyui-linkbutton" iconCls="icon-add" plain="true">新增</a>
			<a href="javascript:openModifyDialog('编辑${entity.cnName} ' ,'../${entity.lowerName}/save.do')" class="easyui-linkbutton" iconCls="icon-edit" plain="true">修改</a>
			<a href="javascript:delete()" class="easyui-linkbutton" iconCls="icon-remove" plain="true">删除</a>
		</div>
		<div>
				<#list searchConditionList as  token>
						<#if token.uiType= 'text' >
							&nbsp;${token.cn_name}：&nbsp;<input type="text" id="${token.compontId}" size="20"  class="easyui-textbox" />&nbsp;
						</#if>
						
						<#if token.uiType= 'select' >
 								<span class="infoname2">${token.cn_name}：</span>
								<select id="${token.compontId}"  name="${token.compontId}" class="text01" >
									<#list token.children as  children>
									    <option value="${children.valueField}">${children.textField}</option>
									</#list>
								</select>
 						</#if>
			   </#list>
			<a href="javascript:search()" class="easyui-linkbutton" iconCls="icon-search" plain="true">搜索</a>
		</div>
	</div>
	
	<!-- 查询表单 --> 
	<table id="dg" title="${entity.cnName}管理" class="easyui-datagrid"  pagination="true" rownumbers="true"  fit="true"  url="../${entity.lowerName}/queryForPage.do"  toolbar="#tb">
		 <thead>
				<tr>
			 		<#list searchDtoList as  token>
						<#if token.uiType != 'hide' >
							<th data-options="field:'${token.compontId}',width:100" align="center">${token.cn_name}</th>
						</#if>
			       </#list>
					
				</tr>
		</thead>
	</table>
	
	
	<!-- 弹出对话框 -->
	<div id="dlg" class="easyui-dialog" style="width: 700px;height:320px;padding: 10px 20px" closed="true" buttons="#dlg-buttons">
		<form id="fm" method="post" novalidate>
		
			 <#list searchDtoList as  token>
					<#if token.uiType= 'hide' >
							<input id="${token.compontId}" name="${token.compontId}" type="hidden" checkbox="true"/>
					</#if>
					<#if token.uiType != 'hide' >
						 <div class="fitem">
			                <label>${token.cn_name}:</label>
			                <input name="${token.compontId}" class="easyui-textbox easyui-validatebox"   data-options="required:true">   
	           			 </div>
					</#if>
			  </#list>
      </form>
	</div> 
	
	

	<!-- 保存和关闭按钮 -->
	<div id="dlg-buttons">
		<a href="javascript:save()" class="easyui-linkbutton" iconCls="icon-ok">保存</a>
		<a href="javascript:closeDialog()" class="easyui-linkbutton" iconCls="icon-cancel">关闭</a>
	</div>
	
</body>
</html>